home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1999 March
/
EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso
/
earcd
/
-archivi
/
-recent2
/
arexxcomm.lha
/
ARexxComm-simple.e
< prev
next >
Wrap
Text File
|
1999-03-21
|
1KB
|
36 lines
/* ARexxComm-simple - a program to demo the BASICS of using ARexxComm! */
MODULE 'CSH/arexxcomm'
PROC main() HANDLE
DEF myport=NIL:PTR TO rxcom ->note we initialised the object pointer to NIL (useful for NILCHECK switch on EC)
WriteF('ARexxComm-simple program\n')
NEW myport.createPort('ExamplePortName3',{myport}) ->try to create our port
IF myport
IF myport.portExists('REXX')=FALSE
->Rexx Master's port does not exist
WriteF('You are not running Rexx Master, so this demo won''t work. Please run it first!\n')
ELSE
->send a messages
myport.sendRexxMsg('REXX','"Say ''Hi!''"') ->note that '' inside a string represents a single ' in reality
WriteF('Sent "Say ''Hi''" message to Rexx Master!\n')
->send another message
myport.sendRexxMsg('REXX','"ADDRESS COMMAND ''list SYS:''"')
WriteF('Sent "ADDRESS COMMAND ''list SYS:''" message to Rexx Master!\n')
Delay(100)
ENDIF
END myport ->don't forget to close our port
ELSE
WriteF('I failed to open a port named "ExamplePortName".\n')
ENDIF
EXCEPT
WriteF('ERROR: Oh no! We had the error "\s"!\n',exceptioninfo)
IF myport THEN END myport ->only close port if it has not been closed already
ENDPROC